<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        .ggl{
            width: 380px;
            height: 100px;
            border: 1px solid black;
            position: relative;
            margin: 20px;
        }
        #dhdhdh{
            position: absolute;
            top:50%;
            left:50%;
            transform: translate(-50%,-50%);
            font-size: 30px;
            color: red;
            z-index: -99;
        }
    </style>
</head>
<body>
    <!-- <div class="ggl">
        <p id="dhdhdh">谢谢惠顾</p>
        <canvas id="bcvccbc" width="280" height="100"></canvas>
       
    </div> -->

    <div class="ggl">
        <canvas id="bcvccbc" width="380" height="100"></canvas>
    </div>

    <script>
        var bcvccbc= document.getElementById("bcvccbc");
        var ctx = bcvccbc.getContext("2d");
            ctx.fillStyle="#999d9c"
            ctx.fillRect(0,0,380,100);
            bcvccbc.onmousedown=function(){
                bcvccbc.onmousemove=function(e){
                    ctx.clearRect(e.offsetX,e.offsetY,5,5)
                }
            }

            bcvccbc.onmouseup=function(){
                bcvccbc.onmousemove=null
            }

    </script>
</body>
</html>